package com.duowei.diandan.preference;

import android.content.Context;
import android.support.v7.preference.Preference;
import android.util.AttributeSet;

import com.takisoft.fix.support.v7.preference.EditTextPreference;

public class SummaryEditTextPreference extends EditTextPreference {

    public SummaryEditTextPreference(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void setText(String text) {
        super.setText(text);
        setSummary(text);
    }

    @Override
    public void onDependencyChanged(Preference dependency, boolean disableDependent) {
        super.onDependencyChanged(dependency, disableDependent);
        setVisible(!disableDependent);
    }
}
